import 'dart:convert';

class DeleteCommentEntity {
  int? code = 0;
  String? message = '';
  bool? data = false; // 返回 true 表示删除成功
  int? timestamp = 0;

  DeleteCommentEntity();

  factory DeleteCommentEntity.fromJson(Map<String, dynamic> json) {
    return DeleteCommentEntity()
      ..code = json['code']
      ..message = json['message']
      ..data = json['data']
      ..timestamp = json['timestamp'];
  }

  Map<String, dynamic> toJson() {
    return {
      'code': code,
      'message': message,
      'data': data,
      'timestamp': timestamp,
    };
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

class DeleteCommentRequest {
  String postId;
  int id; // 评论ID

  DeleteCommentRequest({
    required this.postId,
    required this.id,
  });

  Map<String, dynamic> toJson() {
    return {
      'postId': postId,
      'id': id,
    };
  }
}
